function removeHtmlTag(strx,chop){
	var s = strx.split("<");
	for(var i=0;i<s.length;i++){
		if(s[i].indexOf(">")!=-1){
			s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
		}
	}
	s =  s.join("");
	s = s.substring(0,chop-1);
	return s;
}

function showrecentposts(json) {
	img  = new Array();
              var td = new Array();
  	for (var i = 0; i < numposts; i++) {
    	var entry = json.feed.entry[i];
    	var posttitle = entry.title.$t;
		var pcm;
    	var posturl;
    	if (i == json.feed.entry.length) break;
    	for (var k = 0; k < entry.link.length; k++) {
      		if (entry.link[k].rel == 'alternate') {
        		posturl = entry.link[k].href;
        		break;
      		}
    	}
		
		for (var k = 0; k < entry.link.length; k++) {
      		if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {
        		pcm = entry.link[k].title.split(" ")[0];
        		break;
      		}
    	}
		
    	if ("content" in entry) {
      		var postcontent = entry.content.$t;}
    	else
    	if ("summary" in entry) {
      		var postcontent = entry.summary.$t;}
    	else var postcontent = "";
  		
	s = postcontent	; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);

	if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) {img[i] = d;} else {img[i]="http://1.bp.blogspot.com/_u4gySN2ZgqE/SosvnavWq0I/AAAAAAAAArk/yL95WlyTqr0/s400/noimage.png";}

	var tilen= posttitle.length;
              if (tilen > sumTitle) {
                  td[i]= '<div class="pss_ttt"><div><a title="'+posttitle+'" href="'+posturl+'"><img class="pst_ttimg" src="'+img[i]+'" /></a></div><div class="pst_div"><a title="'+posttitle+'" href="'+posturl+'" class="pst_tt"><h5 style="font-size: 14px !important;font-family: Lato,DroidKufi-bold,Tahoma !important;height:50px">'+posttitle+'</h5></a></div></div>'; 
                  }
              else {
                  td[i]= '<div class="pss_ttt"><div><a title="'+posttitle+'" href="'+posturl+'"><img class="pst_ttimg" src="'+img[i]+'" /></a></div><div class="pst_div"><a title="'+posttitle+'" href="'+posturl+'" class="pst_tt"><h5 style="font-size:14px !important;font-family: Lato,DroidKufi-bold,Tahoma !important;height:50px">'+posttitle+'</h5></a></div></div>'; 
	   }
	
}
var m = numposts / 2;

for (var j=0; j<m; j++) {
if (j%2==0) {

document.write(td[j*2]);
document.write(td[j*2+1]);

}
else {

document.write(td[j*2]);
document.write(td[j*2+1]);

}
}

document.getElementById("rc-posts-loading").style.display = "none";
}
document.write("<script src=\""+home_page+"feeds/posts/default/-/"+label+"?max-results="+numposts+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>");